Skip to content

test(paths): make path assertions cross-platform for win32 - #113

Open
ytexplorer wants to merge 1 commit into
ragTechDev:mainfrom
ytexplorer:fix/win32-paths-test
Open

test(paths): make path assertions cross-platform for win32#113
ytexplorer wants to merge 1 commit into
ragTechDev:mainfrom
ytexplorer:fix/win32-paths-test

Conversation

@ytexplorer

Copy link
Copy Markdown

What

scripts/config/paths.test.ts had 26 of 30 tests failing on Windows. The paths.ts helpers build paths with path.join, which emits the platform-native separator — backslashes on win32 — while the assertions compared against hardcoded forward-slash literals (.toBe('/project/root/...')).

This normalizes the actual value to forward slashes before comparing, keeping the readable forward-slash expected strings. The assertions describe path structure, not separator style.

Why not fix the source

paths.ts producing native separators is correct — real scripts pass these paths to fs/ffmpeg. Forcing POSIX separators in the source would change Windows runtime behavior for no benefit. The bug is in the test's assertions, so the fix is test-only.

Scope

  • One file: scripts/config/paths.test.ts (test-only, zero runtime change).
  • The 4 throw-guard tests were already separator-agnostic and are untouched.

Verification

  • npx jest scripts/config/paths.test.ts30/30 pass (was 26 failed, 4 passed).
  • Full suite green on Windows; the .husky/pre-push hook now passes without --no-verify on this machine.

🤖 Generated with Claude Code

paths.ts builds paths with path.join, which emits the platform-native
separator (backslashes on win32), so the hardcoded forward-slash string
assertions failed on Windows (26 of 30 tests). Normalize the actual value
to forward slashes before comparing — the assertions describe path
structure, not separator style. Source is unchanged; helpers keep emitting
native separators for real fs/ffmpeg consumers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017apBXb1xwSg1g9VshnJ7qK
@victoria-lo
victoria-lo requested a review from missabawse August 22, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant